Skip to content

Conversation

Xopoko
Copy link

@Xopoko Xopoko commented Aug 12, 2025

What

  • Add optional summary to ExecCommandEndEvent with cwd/stdout_tail/stderr_tail and truncation flags.
  • Generate the summary once in core for non‑zero exit codes; clients remain backwards‑compatible.

Why

  • Reduce time lost to opaque failures by surfacing actionable, compact details (without dumping full streams into logs).

How

  • Protocol extension (BC): summary: Option<ExecCommandSummary>.
  • Core: when exit_code != 0, compute 1KB tails from stdout/stderr and include truncation info.
  • TUI/exec: pattern‑match with .. to ignore new field; no behavior change required.

Before/After

  • Before: ExecCommandEnd contained full truncated streams only; errors in logs were often unhelpful.
  • After: on failures, summary captures cwd + tails so logs and users see the key failure context quickly.

Tests

  • Full suite passes (cargo test, cargo clippy --tests, cargo fmt).
  • Optional serde unit test can assert that both Some(summary) and None serialize/deserialize.

Risks

  • Slightly larger event payloads on failures (bounded tails). Secrets masking is handled by existing log policy.

DCO/CLA

  • Signed‑off‑by present on commits. Will sign CLA via comment on this PR.

Xopoko added 2 commits August 12, 2025 15:57
…details

- Adds optional ExecCommandSummary with cwd/stdout_tail/stderr_tail and truncation flags\n- Generates summary in core only for non-zero exit codes\n- Keeps clients backward-compatible; no behavior change required

Signed-off-by: Horoko <[email protected]>
Copy link

github-actions bot commented Aug 12, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

github-actions bot added a commit that referenced this pull request Aug 12, 2025
@Xopoko
Copy link
Author

Xopoko commented Aug 12, 2025

I have read the CLA Document and I hereby sign the CLA

@Xopoko Xopoko marked this pull request as draft August 12, 2025 14:21
@Xopoko Xopoko marked this pull request as ready for review August 12, 2025 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant